#include <iostream>
#include <string>
#define BASE 52
#define MOD 13131313
using namespace std;


string s, t;
long long power, sh[1000005], th;
int ans;

long long getval(char ch) {
    if (ch >= 'a' && ch <= 'z') return ch - 'a';
    return ch - 'A' + 26;
}


int main() {
	cin >> s;
	int lens = s.size();
	for (int i = 0; i < lens; ++i) {
		th = ((th * BASE) % MOD + getval(s[i])) % MOD;
	}
	cin >> t;
	int lent = t.size();
	sh[1] = getval(t[0]) % MOD;
	for (int i = 1; i < lent; ++i) {
		sh[i+1] = ((sh[i] * BASE) % MOD + getval(t[i])) % MOD;
	}

	power = 1;
	for (int i = 0; i < lens; ++i) {
		power = power * BASE % MOD;
	}

	int l = 1;
	while (l <= lent - lens + 1) {
		long long w = ((sh[l+lens-1] - sh[l-1] * power % MOD) + MOD) % MOD;
		if (w == th) {
			++ans;
			l += lens;
		} else {
			++l;
		}
	}
	cout << ans << endl;
	return 0;
}